﻿using System.Collections;
using System.Collections.Generic;
using App.Common;
using UnityEngine;
using Chronos;
using System;

public enum SkillType
{
    Positive,
    Passive,
}
public abstract class SkillBase : ScriptableObject
{

    public EntityBase User;

    public SkillType skillType;
    public int skillLevel;

    public float colddownTime;
    public float colddownTimer;
    public bool isColddown;
    public virtual void Init(EntityBase user)
    {
        User = user;
    }

    public virtual void Damage(EventArgs args)
    {

    }

    public virtual void Awake()
    {
    }

    public virtual void Update()
    {
    }
    public virtual void LateUpdate()
    {
    }

    public virtual void FixedUpdate()
    {
    }

   public void ColdDownInit()
    {
        isColddown = false;
        colddownTime = 0.5f;
        colddownTimer = colddownTime;
    }

    public void ColdDownCheck()
    {
        if (isColddown)
        {
            colddownTimer -= User.time.deltaTime;
        }
        if (colddownTimer <= 0)
        {
            isColddown = false;
            colddownTimer = colddownTime;
        }
    }
}

